from flask import Blueprint, send_file

from pathlib import Path

from app.log import logger

app = Blueprint('index', __name__, url_prefix='/')

# http://localhost:5000/
@app.route('/')
def index_ui():
    logger.info("Hello Flask!")
    return send_file(str(Path.cwd() / 'static' / 'index.html'))

@app.route('/favicon.ico')
def favicon():
    return send_file(str(Path.cwd() / 'static' / 'favicon.png'))

@app.route('/css/<resource_name>')
def css(resource_name):
    return send_file(str(Path.cwd() / 'static' / 'css' / resource_name))

@app.route('/js/<resource_name>')
def js(resource_name):
    return send_file(str(Path.cwd() / 'static' / 'js' / resource_name))

